//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//**********************************************************************
// $Header: $
//
// $Revision: $
//
// $Date: $
//**********************************************************************

//<AMI_FHDR_START>
//---------------------------------------------------------------------------
//
// Name:    CmosTables.c
//
// Description: Contains the global static data tables that are initialized
//              from AmiSsp2.exe output during the build process. These
//              tables are used in the PEI phase and passed, as needed,
//              to DXE via HOB data structure.
//
//              This file must always be included in source form.
//
//---------------------------------------------------------------------------
//<AMI_FHDR_END>

//<AMI_GHDR_START>
//----------------------------------------------------------------------------
//
// Name:    Initialization_Tables
//
// Description:        
//      This page provides links to descriptions of the major tables used in 
//      initializing/supporting the CMOS Manager module.
//
// Fields:  Phase  Name  Description
// ------------------------------------------------------------------
// ALL  gCmosTokenTable             all SSP defined tokens
// ALL  gCmosOptimalDefaultTable    default values for all CMOS registers
// ALL  gCmosNoCheckSumTable        CMOS addresses that are not checksummed
//
//----------------------------------------------------------------------------
//<AMI_GHDR_END>


#include <Efi.h>
#if (MODULE_TYPE == PEIM)
    #include <Pei.h>
    #include <AmiPeiLib.h>
#else
    #include <AmiDxeLib.h>
#endif
#include "CmosManager.h"
#include "CmosManagerHob.h"
#include <SspData.h>

CONST UINT8   gFirstManagedRegister = FIRST_CMOS_REGISTER;  
CONST UINT8   gLastManagedRegister = LAST_CMOS_REGISTER;

//<AMI_THDR_START>
//---------------------------------------------------------------------------
//
// Name:   gCmosTokenTable
//
// Description: 
//      This is a table of CMOS tokens derived from macros defined in 
//      SspData.h, which is generated by AmiSsp2.exe during the build 
//      process.
//
// Notes:
//      This is an array of type: CMOS_TOKEN
//
//---------------------------------------------------------------------------
//<AMI_THDR_END>

#define USING_SSP_MACROS
CMOS_TOKEN  gCmosTokenTable[] = {         // to DXE via HOB
    {0},                                        // Index starts at 1
    #define CmosTokenTable(name,val) {val},
#include <SspData.h>
};
CONST UINT16 gCmosTokenTableSize = CMOS_TOKEN_COUNT(gCmosTokenTable);


//<AMI_THDR_START>
//---------------------------------------------------------------------------
//
// Name:   gCmosOptimalDefaultTable
//
// Description: 
//      This is a table of default (or optimal) CMOS register values derived 
//      from macros defined in SspData.h, which is generated by AmiSsp2.exe 
//      during the build process.
//
// Notes:
//      This is an array of type: CMOS_REGISTER
//
//---------------------------------------------------------------------------
//<AMI_THDR_END>

#define USING_SSP_MACROS
CMOS_REGISTER  gCmosOptimalDefaultTable[] = {   // to DXE via HOB
{0},                                                // Index starts at 1
#define NvramOptimalDataTable(val) {val},
#include <SspData.h>
};
CONST UINT16 gCmosOptimalDefaultTableSize = 
                    CMOS_REGISTER_COUNT(gCmosOptimalDefaultTable);
 

//<AMI_THDR_START>
//---------------------------------------------------------------------------
//
// Name:   gCmosNoCheckSumTable
//
// Description: 
//      This is a table of CMOS registers excluded from checksum 
//      calculations.  This table is derived from macros defined in 
//      SspData.h, which is generated by AmiSsp2.exe during the build 
//      process.
//
// Notes:
//      This is an array of type: CMOS_REGISTER
//
//---------------------------------------------------------------------------
//<AMI_THDR_END>

#define USING_SSP_MACROS
CONST CMOS_REGISTER  gCmosNoCheckSumTable[] = {   // to DXE via HOB
{0},                                        // Index starts at 1
#define NonChecksumTable(val) {val},
#include <SspData.h>
};
CONST UINT16 gCmosNoCheckSumTableSize = 
                    CMOS_REGISTER_COUNT(gCmosNoCheckSumTable);


//<AMI_THDR_START>
//---------------------------------------------------------------------------
//
// Name:   gUnmanagedTable
//
// Description: 
//      This is a table of CMOS registers that are allocated, but otherwise
//      unmanaged.  The purpose is to provide support for locations that
//      must be written prior to CMOS Manager, and to provide alternative
//      mechanisms in situations where CMOS Manager's loading of default 
//      values would cause major implementation problems.
//
// Notes:
//      This is an array of type: CMOS_REGISTER
//
//      It is up to the owner of the SSP CMOS Token to determine whether
//      or not the value of an un-managed location is valid.
//
//---------------------------------------------------------------------------
//<AMI_THDR_END>

#define USING_SSP_MACROS
CONST CMOS_REGISTER  gUnmanagedTable[] = {   
{0},                                        // Index starts at 1
#define UnmanagedTable(val) {val},
#include <SspData.h>
};
CONST UINT16 gUnmanagedTableSize = 
                    CMOS_REGISTER_COUNT(gUnmanagedTable);

//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************
